/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: MyUser
 * Author:   zhouheng
 * Date:     2019/6/8 22:15
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.golden.system.domain;

import com.zhouh.golden.common.annotation.ExportConfig;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/6/8
 * @since 1.0.0
 */
@Data
@ToString
@Table(name = "t_user")
public class MyUser implements Serializable {
    private static final long serialVersionUID = -4852732617765810959L;

    /**
     * 账户状态
     */
    public static final String STATUS_VALID = "1";

    public static final String STATUS_LOCK = "0";

    public static final String DEFAULT_THEME = "green";

    public static final String DEFAULT_AVATAR = "default.jpg";

    /**
     * 性别
     */
    public static final String SEX_MALE = "0";

    public static final String SEX_FEMALE = "1";

    public static final String SEX_UNKNOW = "2";

    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "user_id")
    private Long userId;

    @ExportConfig(value = "用户名")
    @Column(name = "username")
    private String username;

    @Column(name = "PASSWORD")
    private String password;

    @Column(name = "DEPT_ID")
    private Long deptId;

    @ExportConfig(value = "部门")
    @Transient
    private String deptName;

    @ExportConfig(value = "邮箱")
    @Column(name = "EMAIL")
    private String email;

    @ExportConfig(value = "手机")
    @Column(name = "MOBILE")
    private String mobile;

    @ExportConfig(value = "状态", convert = "s:0=锁定,1=有效")
    @Column(name = "STATUS")
    private String status = STATUS_VALID;

    @ExportConfig(value = "创建时间", convert = "c:cc.mrbird.common.utils.poi.convert.TimeConvert")
    @Column(name = "CRATE_TIME")
    private Date crateTime;

    @Column(name = "MODIFY_TIME")
    private Date modifyTime;

    @Column(name = "LAST_LOGIN_TIME")
    private Date lastLoginTime;

    @ExportConfig(value = "性别", convert = "s:0=男,1=女,2=保密")
    @Column(name = "SSEX")
    private String ssex;

    @ExportConfig(value = "主题")
    @Column(name = "THEME")
    private String theme;

    @Column(name = "AVATAR")
    private String avatar;

    @Column(name = "DESCRIPTION")
    private String description;

    @Transient
    private String roleName;
}